package com.ymatou.operate.trading.api.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.operate.trading.api.parameter.TriggerOrderRefundBean;
import com.ymatou.operate.trading.api.service.TriggerOrderRefundCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
/**
*退款结算自动触发接口
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_TriggerOrderRefund{
	private static TriggerOrderRefundBean triggerorderrefundBean;
	private static TriggerOrderRefundCall triggerorderrefundCall;
	private static int orderid=1233;
	private static String tradeNo="1233";
	private static String sign="20160324";
	private static float actualRefundAmount=1233;
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("退款结算自动触发接口");
	}

	@Before
	public void caseUp() {
		triggerorderrefundBean=new TriggerOrderRefundBean();
		triggerorderrefundCall=new TriggerOrderRefundCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(triggerorderrefundCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	//@Ignore
	@Test
	@Category(P1.class)
	@TestCase	
	public void Tc_TriggerOrderRefund_001() {
		Logger.start(true,"定金触发退款结算成功");
		try {
			//TODO 补全case代码
			triggerorderrefundBean.setOrderID(orderid);
			triggerorderrefundBean.setTradeNo(tradeNo);
			triggerorderrefundBean.setSign(sign);
			triggerorderrefundBean.setActualRefundAmount(actualRefundAmount);
			
			triggerorderrefundCall.setData(triggerorderrefundBean);
			triggerorderrefundCall.callService();			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Ignore
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_TriggerOrderRefund_002() {
		Logger.start(true,"尾款触发退款结算成功");
		try {
			//TODO 补全case代码
			triggerorderrefundBean.setOrderID(orderid);
			triggerorderrefundBean.setTradeNo(tradeNo);
			triggerorderrefundBean.setSign(sign);
			triggerorderrefundBean.setActualRefundAmount(actualRefundAmount);
			
			triggerorderrefundCall.setData(triggerorderrefundBean);
			triggerorderrefundCall.callService();		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}